<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org" />
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<title>Manual Page for sudo_open</title>

<style type="text/css">
/*<![CDATA[*/
<!--.red {color: #CC0000}-->
/*]]>*/
</style>

<style type="text/css">
/*<![CDATA[*/
<!--.hed {color: #000000; font-weight: bold; font-size: larger;}-->
/*]]>*/
</style>
</head>
<body>
<pre>
 <a href=
"http://sage.ucsc.edu/Library/init/zsh/man/html/open.html">open(1)</a>                  Mac OS X Darwin customization                 <a href="http://sage.ucsc.edu/Library/init/zsh/man/html/open.html">open(1)</a>



<span class="hed">NAME</span>
       <span class=
"red">open</span> - command-line equivalent of double-clicking to open OS X applica-
       tions, files, urls,  x-windows  unix  programs,  preference  panes  and
       directories.   This is an enhanced version (a superset) of Apple's <span class="red">open</span>
       command, and (unlike Apple's version) uses a powerful and nuanced  <span class="red">cus-</span>
       <span class="red">tomizable</span> <span class=
"red">command</span> <span class=
"red">completion</span> <span class=
"red">mechanism</span> for the <span class=
"red">open</span> command.

<span class="hed">SYNOPSIS</span>
       <span class="red">open</span> <span class=
"red">[</span> -aeFfpswxh <span class="red">]</span> <span class=
"red">[</span> <u>application-name</u> <span class=
"red">]</span> <u>file</u> <span class="red">...</span>

<span class="hed">DESCRIPTION</span>
       The  <span class=
"red">open</span>  function  augments  Apple's  distributed open command with a
       super-set of functionality.  It opens a file (or a  directory,  Prefer-
       ence  Pane,  Application,  Widget  or  URL), just as if you had double-
       clicked the file's icon. The augmented version incorporates a  powerful
       zsh command completion system. If no application name is specified, the
       default application as determined via LaunchServices is  used  to  open
       the  specified  files.  This works with a programmed command completion
       for all OS X Application names.   This  mechanism  in  turn  relies  on
       mdfind in 10.4 and above, or an up-to-date locatedb in 10.3.

       The  distributed function <span class=
"red">enable_faster_open</span> can be run to aid the user
       in taking full advantage of the open completion mechanism  and  ensures
       that  it  operates  optimally.   In  10.4 this is done with a dedicated
       launchd item, and in 10.3 it is done using the locatedb.

       If the file is in the form of a URL, the file will be opened as a  URL.

       If the name of a PreferencePane is given with the -p flag, System Pref-
       erences will open to that pane.  This works with a  command  completion
       for each installed PreferencePane.

       You can specify one or more file names (or pathnames), which are inter-
       preted relative to the  shell  or  Terminal  window's  current  working
       directory. For example, the following command would open all Word files
       in the current working directory:

       open *.doc


<span class="hed">OPTIONS</span>
       -a foo [bar]
              <span class="red">Opens</span> <span class=
"red">application</span> <span class="red">foo</span> <span class=
"red">[and</span> <span class="red">file</span> <span class=
"red">bar]</span>


       -d bar <span class="red">Opens</span> <span class=
"red">file</span> <span class="red">with</span> <span class=
"red">default</span> <span class="red">application</span>


       -e bar <span class="red">Force</span> <span class=
"red">the</span> <span class="red">file</span> <span class=
"red">bar</span> <span class="red">to</span> <span class=
"red">open</span> <span class="red">with</span> <span class=
"red">TextEdit</span>


       -f     <span class="red">Reads</span> <span class=
"red">piped</span> <span class="red">input</span> <span class=
"red">and</span> <span class="red">opens</span> <span class=
"red">with</span> <span class="red">TextEdit.</span>


       -F bar <span class="red">Force</span> <span class=
"red">the</span> <span class="red">file</span> <span class=
"red">bar</span> <span class="red">to</span> <span class=
"red">open</span> <span class="red">with</span> <span class=
"red">edit</span> <span class="red">function.</span>


       -p bar.prefPane
              <span class="red">Open</span> <span class=
"red">named</span> <span class="red">System</span> <span class=
"red">Preferences</span> <span class=
"red">preference</span> <span class="red">pane.</span>


       -s bar <span class="red">Force</span> <span class=
"red">the</span> <span class="red">file</span> <span class=
"red">bar</span> <span class="red">to</span> <span class=
"red">open</span> <span class="red">with</span> <span class=
"red">sudo</span> <span class="red">open.</span>


       -w [foobar]
              <span class="red">Open</span> <span class=
"red">the</span> <span class="red">Widget</span> <span class=
"red">named</span> <span class="red">foobar</span>


       -x foo [bar]
              <span class="red">Force</span> <span class=
"red">the</span> <span class="red">program</span> <span class=
"red">foo</span> <span class="red">to</span> <span class=
"red">open</span> <span class="red">[file</span> <span class=
"red">bar]</span> <span class="red">with</span> <span class=
"red">open-X11.</span>


       -h     <span class="red">Obtain</span> <span class=
"red">program</span> <span class="red">help</span> <span class=
"red">info.</span>


<span class="hed">FILES</span>
       <u>~/.zsh/zshapplist</u>
              An updatable listing cache of Application names to be  used  for
              completing  the  <span class=
"red">open</span>  <span class=
"red">-a</span>  command.  See  <a href=
"http://sage.ucsc.edu/Library/init/zsh/man/html/comp_appgetter.html">comp_appgetter(1)</a>  and
              <a href=
"http://sage.ucsc.edu/Library/init/zsh/man/html/enable_faster_open.html">enable_faster_open(1)</a> for further details.
       <span class="red">_</span><u>open</u> <span class=
"red">_</span><u>mac_</u><u>applications</u>  <span class=
"red">_</span><u>mac_</u><u>files_</u><u>for_</u><u>application</u>  <span class="red">_</span><u>retrieve_</u><u>mac_</u><u>apps</u>
       <span class=
"red">_</span><u>comp_</u><u>appgetter</u> <u>enable_</u><u>faster_</u><u>open</u>
              are  all  zsh functions that must be in the $fpath array for the
              elaborate <span class=
"red">_open</span> completion system to work properly.


<span class="hed">EXAMPLES</span>
       open -a Microsoft\ Word <span class=
"red">or</span> open -a "Microsoft Word" <span class=
"red">opens</span> <span class="red">the</span>  <span class=
"red">applica-</span>
       <span class="red">tion</span> <span class=
"red">named</span> <span class="red">'Microsoft</span> <span class=
"red">Word'</span>

       open  -a  Wor <u>&lt;tabkey&gt;</u> <span class=
"red">completes</span> <span class="red">the</span> <span class=
"red">line</span> <span class=
"red">replacing</span> Wor <span class="red">with</span> Microsoft\
       Word

       open -a Microsoft\ Word foo.doc <span class=
"red">opens</span>  <span class="red">the</span>  <span class=
"red">file</span>  <span class="red">'foo.doc'</span>  <span class=
"red">using</span>  <span class="red">the</span>
       <span class="red">application</span> <span class=
"red">named</span> <span class="red">'Microsoft</span> <span class=
"red">Word'</span>

       open -p Accounts.prefPane <span class=
"red">opens</span> <span class="red">the</span> <span class=
"red">Preference</span> <span class="red">Pane</span> <span class=
"red">'Accounts'</span> <span class="red">in</span> <span class=
"red">'Sys-</span>
       <span class="red">tem</span> <span class=
"red">Preferences'</span>

       open -p Acco <u>&lt;tabkey&gt;</u> <span class=
"red">completes</span> <span class="red">with</span> <span class=
"red">'</span> open -p Accounts.prefPane <span class="red">'</span>

       open .  <span class="red">opens</span> <span class=
"red">a</span> <span class="red">finder</span> <span class=
"red">window</span> <span class="red">in</span> <span class=
"red">the</span> <span class="red">current</span> <span class=
"red">directory.</span>

       open /Volumes/Macintosh HD/foo.txt <span class=
"red">opens</span> <span class="red">the</span> <span class=
"red">document</span>  <span class="red">in</span>  <span class=
"red">the</span>  <span class="red">default</span>
       <span class="red">application</span> <span class=
"red">for</span> <span class="red">its</span> <span class=
"red">type</span> <span class="red">(as</span> <span class=
"red">determined</span> <span class="red">by</span> <span class=
"red">LaunchServices).</span>

       open  /Volumes/Macintosh  HD/Applications/  <span class=
"red">opens</span> <span class="red">that</span> <span class=
"red">directory</span> <span class="red">in</span> <span class=
"red">the</span>
       <span class="red">Finder.</span>

       open -a TextEdit /Volumes/Macintosh HD/foo.txt' opens the  document  in
       the application specified (in this case, TextEdit).

       open -e /Volumes/Macintosh HD/foo.txt <span class=
"red">opens</span> <span class="red">the</span> <span class=
"red">document</span> <span class="red">in</span> <span class=
"red">TextEdit.</span>

       open http://www.apple.com/ <span class=
"red">opens</span> <span class="red">the</span> <span class=
"red">URL</span> <span class="red">in</span> <span class=
"red">the</span> <span class="red">default</span> <span class=
"red">browser.</span>

       open  file://localhost/Volumes/Macintosh  HD/foo.txt <span class="red">opens</span> <span class="red">the</span> <span class="red">document</span>
       <span class="red">in</span> <span class=
"red">the</span> <span class="red">default</span> <span class=
"red">application</span> <span class="red">for</span> <span class=
"red">its</span> <span class="red">type</span> <span class=
"red">(as</span>  <span class="red">determined</span>  <span class=
"red">by</span>  <span class="red">LaunchSer-</span>
       <span class="red">vices).</span>

       open  file://localhost/Volumes/Macintosh  HD/Applications/  <span class="red">opens</span>  <span class="red">that</span>
       <span class="red">directory</span> <span class=
"red">in</span> <span class="red">the</span> <span class=
"red">Finder.</span>


<span class="hed">HISTORY</span>
       Apple's <span class=
"red">open</span> command first appeared in NextStep, and is distributed  in
       OS  X  Darwin.  The <span class=
"red">open</span> function was written as a shell-script wrapper
       for Apple's <span class=
"red">open</span> to include  additional  functionality,  and  has  been
       incorporated,  along with an elaborate set of command completions, as a
       <span class="red">zsh</span> <span class=
"red">function</span> in the <u>zsh-templates</u> <u>package.</u>   The  completions  for  the
       <span class=
"red">open</span>  command  were written by Motoi Washida (Nov 12, 2004 CVS version)
       and subsequently modified by W. G. Scott, Wataru Kagawa and others.






<span class="hed">AUTHORS</span>
       The <span class=
"red">open</span> command is Copyright (c) 2001 Apple Computer, Inc. All  Rights
       Reserved.   The  <span class=
"red">open</span>  shell  script is a wrapper for the original <span class="red">open</span>
       program, which remains unaltered.  The <span class=
"red">open</span> shell script (and zsh func-
       tion) was written by W. G. Scott and is public domain.

       The  <span class=
"red">_open</span>  command  completion  function was re-written by W. G. Scott
       based on that of Motoi Washida.  The other functions that _open depends
       on  were  written  entirely by Motoi Washida, except for <span class="red">comp_appgetter</span>
       which was written by W. G. Scott.


<span class="hed">SEE ALSO</span>
       <a href=
"http://sage.ucsc.edu/Library/init/zsh/man/html/open-x11.html">open-x11(1)</a>,  <a href="http://sage.ucsc.edu/Library/init/zsh/man/html/comp_appgetter.html">comp_appgetter(1)</a>,   <a href="http://sage.ucsc.edu/Library/init/zsh/man/html/enable_faster_open.html">enable_faster_open(1)</a>   <a href="http://sage.ucsc.edu/Library/init/zsh/man/html/sudo_open.html">sudo_open(1)</a>
       <a href=
"http://sage.ucsc.edu/Library/init/zsh/man/html/edit.html">edit(1)</a>




Mac OS X                        January 4, 2005                        <a href="http://sage.ucsc.edu/Library/init/zsh/man/html/open.html">open(1)</a>
</pre>
</body>
</html>
